package com.ljh.user.convert;

import com.ljh.api.pojo.UserInfoRegisterRequest;
import com.ljh.common.utils.SecurityUtil;
import com.ljh.user.dataobject.UserInfo;
import org.springframework.beans.BeanUtils;

/**
 * @author: Themberfue
 * @date: 2025/4/23 21:10
 * @description:
 */
public class BeanConvert {
    public static UserInfo convertToUserInfo(UserInfoRegisterRequest request) {
        UserInfo userInfo = new UserInfo();
        BeanUtils.copyProperties(request, userInfo);
        userInfo.setPassword(SecurityUtil.encrypt(
                request.getPassword()
        ));
        return userInfo;
    }
}
